Optimal. Leaf size=171 \[ \frac {1}{16} b \left (18 a^2+5 b^2\right ) x-\frac {a \left (a^2+3 b^2\right ) \cos (e+f x)}{f}+\frac {a \left (a^2+6 b^2\right ) \cos ^3(e+f x)}{3 f}-\frac {3 a b^2 \cos ^5(e+f x)}{5 f}-\frac {b \left (18 a^2+5 b^2\right ) \cos (e+f x) \sin (e+f x)}{16 f}-\frac {b \left (18 a^2+5 b^2\right ) \cos (e+f x) \sin ^3(e+f x)}{24 f}-\frac {b^3 \cos (e+f x) \sin ^5(e+f x)}{6 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 193, normalized size of antiderivative = 1.13, number of steps
used = 8, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {2872, 3102,
2827, 2713, 2715, 8} \begin {gather*} \frac {a \left (5 a^2+12 b^2\right ) \cos ^3(e+f x)}{15 f}-\frac {a \left (5 a^2+12 b^2\right ) \cos (e+f x)}{5 f}-\frac {b \left (18 a^2+5 b^2\right ) \sin ^3(e+f x) \cos (e+f x)}{24 f}-\frac {b \left (18 a^2+5 b^2\right ) \sin (e+f x) \cos (e+f x)}{16 f}+\frac {1}{16} b x \left (18 a^2+5 b^2\right )-\frac {13 a b^2 \sin ^4(e+f x) \cos (e+f x)}{30 f}-\frac {b^2 \sin ^4(e+f x) \cos (e+f x) (a+b \sin (e+f x))}{6 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2713
Rule 2715
Rule 2827
Rule 2872
Rule 3102
Rubi steps
\begin {align*} \int \sin ^3(e+f x) (a+b \sin (e+f x))^3 \, dx &=-\frac {b^2 \cos (e+f x) \sin ^4(e+f x) (a+b \sin (e+f x))}{6 f}+\frac {1}{6} \int \sin ^3(e+f x) \left (2 a \left (3 a^2+2 b^2\right )+b \left (18 a^2+5 b^2\right ) \sin (e+f x)+13 a b^2 \sin ^2(e+f x)\right ) \, dx\\ &=-\frac {13 a b^2 \cos (e+f x) \sin ^4(e+f x)}{30 f}-\frac {b^2 \cos (e+f x) \sin ^4(e+f x) (a+b \sin (e+f x))}{6 f}+\frac {1}{30} \int \sin ^3(e+f x) \left (6 a \left (5 a^2+12 b^2\right )+5 b \left (18 a^2+5 b^2\right ) \sin (e+f x)\right ) \, dx\\ &=-\frac {13 a b^2 \cos (e+f x) \sin ^4(e+f x)}{30 f}-\frac {b^2 \cos (e+f x) \sin ^4(e+f x) (a+b \sin (e+f x))}{6 f}+\frac {1}{6} \left (b \left (18 a^2+5 b^2\right )\right ) \int \sin ^4(e+f x) \, dx+\frac {1}{5} \left (a \left (5 a^2+12 b^2\right )\right ) \int \sin ^3(e+f x) \, dx\\ &=-\frac {b \left (18 a^2+5 b^2\right ) \cos (e+f x) \sin ^3(e+f x)}{24 f}-\frac {13 a b^2 \cos (e+f x) \sin ^4(e+f x)}{30 f}-\frac {b^2 \cos (e+f x) \sin ^4(e+f x) (a+b \sin (e+f x))}{6 f}+\frac {1}{8} \left (b \left (18 a^2+5 b^2\right )\right ) \int \sin ^2(e+f x) \, dx-\frac {\left (a \left (5 a^2+12 b^2\right )\right ) \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,\cos (e+f x)\right )}{5 f}\\ &=-\frac {a \left (5 a^2+12 b^2\right ) \cos (e+f x)}{5 f}+\frac {a \left (5 a^2+12 b^2\right ) \cos ^3(e+f x)}{15 f}-\frac {b \left (18 a^2+5 b^2\right ) \cos (e+f x) \sin (e+f x)}{16 f}-\frac {b \left (18 a^2+5 b^2\right ) \cos (e+f x) \sin ^3(e+f x)}{24 f}-\frac {13 a b^2 \cos (e+f x) \sin ^4(e+f x)}{30 f}-\frac {b^2 \cos (e+f x) \sin ^4(e+f x) (a+b \sin (e+f x))}{6 f}+\frac {1}{16} \left (b \left (18 a^2+5 b^2\right )\right ) \int 1 \, dx\\ &=\frac {1}{16} b \left (18 a^2+5 b^2\right ) x-\frac {a \left (5 a^2+12 b^2\right ) \cos (e+f x)}{5 f}+\frac {a \left (5 a^2+12 b^2\right ) \cos ^3(e+f x)}{15 f}-\frac {b \left (18 a^2+5 b^2\right ) \cos (e+f x) \sin (e+f x)}{16 f}-\frac {b \left (18 a^2+5 b^2\right ) \cos (e+f x) \sin ^3(e+f x)}{24 f}-\frac {13 a b^2 \cos (e+f x) \sin ^4(e+f x)}{30 f}-\frac {b^2 \cos (e+f x) \sin ^4(e+f x) (a+b \sin (e+f x))}{6 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.49, size = 147, normalized size = 0.86 \begin {gather*} \frac {-360 a \left (2 a^2+5 b^2\right ) \cos (e+f x)+20 \left (4 a^3+15 a b^2\right ) \cos (3 (e+f x))+b \left (-36 a b \cos (5 (e+f x))+5 \left (216 a^2 e+60 b^2 e+216 a^2 f x+60 b^2 f x-9 \left (16 a^2+5 b^2\right ) \sin (2 (e+f x))+9 \left (2 a^2+b^2\right ) \sin (4 (e+f x))-b^2 \sin (6 (e+f x))\right )\right )}{960 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.41, size = 145, normalized size = 0.85
method | result | size |
derivativedivides | \(\frac {b^{3} \left (-\frac {\left (\sin ^{5}\left (f x +e \right )+\frac {5 \left (\sin ^{3}\left (f x +e \right )\right )}{4}+\frac {15 \sin \left (f x +e \right )}{8}\right ) \cos \left (f x +e \right )}{6}+\frac {5 f x}{16}+\frac {5 e}{16}\right )-\frac {3 a \,b^{2} \left (\frac {8}{3}+\sin ^{4}\left (f x +e \right )+\frac {4 \left (\sin ^{2}\left (f x +e \right )\right )}{3}\right ) \cos \left (f x +e \right )}{5}+3 a^{2} b \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )-\frac {a^{3} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}}{f}\) | \(145\) |
default | \(\frac {b^{3} \left (-\frac {\left (\sin ^{5}\left (f x +e \right )+\frac {5 \left (\sin ^{3}\left (f x +e \right )\right )}{4}+\frac {15 \sin \left (f x +e \right )}{8}\right ) \cos \left (f x +e \right )}{6}+\frac {5 f x}{16}+\frac {5 e}{16}\right )-\frac {3 a \,b^{2} \left (\frac {8}{3}+\sin ^{4}\left (f x +e \right )+\frac {4 \left (\sin ^{2}\left (f x +e \right )\right )}{3}\right ) \cos \left (f x +e \right )}{5}+3 a^{2} b \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )-\frac {a^{3} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}}{f}\) | \(145\) |
risch | \(\frac {9 a^{2} b x}{8}+\frac {5 b^{3} x}{16}-\frac {3 a^{3} \cos \left (f x +e \right )}{4 f}-\frac {15 a \,b^{2} \cos \left (f x +e \right )}{8 f}-\frac {b^{3} \sin \left (6 f x +6 e \right )}{192 f}-\frac {3 a \,b^{2} \cos \left (5 f x +5 e \right )}{80 f}+\frac {3 b \sin \left (4 f x +4 e \right ) a^{2}}{32 f}+\frac {3 b^{3} \sin \left (4 f x +4 e \right )}{64 f}+\frac {\cos \left (3 f x +3 e \right ) a^{3}}{12 f}+\frac {5 \cos \left (3 f x +3 e \right ) a \,b^{2}}{16 f}-\frac {3 b \sin \left (2 f x +2 e \right ) a^{2}}{4 f}-\frac {15 b^{3} \sin \left (2 f x +2 e \right )}{64 f}\) | \(184\) |
norman | \(\frac {-\frac {20 a^{3}+48 a \,b^{2}}{15 f}+\frac {b \left (18 a^{2}+5 b^{2}\right ) x}{16}-\frac {4 a^{3} \left (\tan ^{8}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {4 \left (10 a^{3}+24 a \,b^{2}\right ) \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 f}-\frac {\left (16 a^{3}+48 a \,b^{2}\right ) \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {2 \left (20 a^{3}+48 a \,b^{2}\right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{5 f}-\frac {3 b \left (14 a^{2}+11 b^{2}\right ) \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4 f}+\frac {3 b \left (14 a^{2}+11 b^{2}\right ) \left (\tan ^{7}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4 f}-\frac {b \left (18 a^{2}+5 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{8 f}-\frac {17 b \left (18 a^{2}+5 b^{2}\right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{24 f}+\frac {17 b \left (18 a^{2}+5 b^{2}\right ) \left (\tan ^{9}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{24 f}+\frac {b \left (18 a^{2}+5 b^{2}\right ) \left (\tan ^{11}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{8 f}+\frac {3 b \left (18 a^{2}+5 b^{2}\right ) x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{8}+\frac {15 b \left (18 a^{2}+5 b^{2}\right ) x \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{16}+\frac {5 b \left (18 a^{2}+5 b^{2}\right ) x \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4}+\frac {15 b \left (18 a^{2}+5 b^{2}\right ) x \left (\tan ^{8}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{16}+\frac {3 b \left (18 a^{2}+5 b^{2}\right ) x \left (\tan ^{10}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{8}+\frac {b \left (18 a^{2}+5 b^{2}\right ) x \left (\tan ^{12}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{16}}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{6}}\) | \(475\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 157, normalized size = 0.92 \begin {gather*} \frac {320 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} a^{3} + 90 \, {\left (12 \, f x + 12 \, e + \sin \left (4 \, f x + 4 \, e\right ) - 8 \, \sin \left (2 \, f x + 2 \, e\right )\right )} a^{2} b - 192 \, {\left (3 \, \cos \left (f x + e\right )^{5} - 10 \, \cos \left (f x + e\right )^{3} + 15 \, \cos \left (f x + e\right )\right )} a b^{2} + 5 \, {\left (4 \, \sin \left (2 \, f x + 2 \, e\right )^{3} + 60 \, f x + 60 \, e + 9 \, \sin \left (4 \, f x + 4 \, e\right ) - 48 \, \sin \left (2 \, f x + 2 \, e\right )\right )} b^{3}}{960 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.34, size = 145, normalized size = 0.85 \begin {gather*} -\frac {144 \, a b^{2} \cos \left (f x + e\right )^{5} - 80 \, {\left (a^{3} + 6 \, a b^{2}\right )} \cos \left (f x + e\right )^{3} - 15 \, {\left (18 \, a^{2} b + 5 \, b^{3}\right )} f x + 240 \, {\left (a^{3} + 3 \, a b^{2}\right )} \cos \left (f x + e\right ) + 5 \, {\left (8 \, b^{3} \cos \left (f x + e\right )^{5} - 2 \, {\left (18 \, a^{2} b + 13 \, b^{3}\right )} \cos \left (f x + e\right )^{3} + 3 \, {\left (30 \, a^{2} b + 11 \, b^{3}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{240 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 393 vs.
\(2 (155) = 310\).
time = 0.46, size = 393, normalized size = 2.30 \begin {gather*} \begin {cases} - \frac {a^{3} \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 a^{3} \cos ^{3}{\left (e + f x \right )}}{3 f} + \frac {9 a^{2} b x \sin ^{4}{\left (e + f x \right )}}{8} + \frac {9 a^{2} b x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{4} + \frac {9 a^{2} b x \cos ^{4}{\left (e + f x \right )}}{8} - \frac {15 a^{2} b \sin ^{3}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{8 f} - \frac {9 a^{2} b \sin {\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{8 f} - \frac {3 a b^{2} \sin ^{4}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {4 a b^{2} \sin ^{2}{\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{f} - \frac {8 a b^{2} \cos ^{5}{\left (e + f x \right )}}{5 f} + \frac {5 b^{3} x \sin ^{6}{\left (e + f x \right )}}{16} + \frac {15 b^{3} x \sin ^{4}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{16} + \frac {15 b^{3} x \sin ^{2}{\left (e + f x \right )} \cos ^{4}{\left (e + f x \right )}}{16} + \frac {5 b^{3} x \cos ^{6}{\left (e + f x \right )}}{16} - \frac {11 b^{3} \sin ^{5}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{16 f} - \frac {5 b^{3} \sin ^{3}{\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{6 f} - \frac {5 b^{3} \sin {\left (e + f x \right )} \cos ^{5}{\left (e + f x \right )}}{16 f} & \text {for}\: f \neq 0 \\x \left (a + b \sin {\left (e \right )}\right )^{3} \sin ^{3}{\left (e \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.46, size = 180, normalized size = 1.05 \begin {gather*} -\frac {3 \, a b^{2} \cos \left (5 \, f x + 5 \, e\right )}{80 \, f} - \frac {b^{3} \sin \left (6 \, f x + 6 \, e\right )}{192 \, f} + \frac {1}{16} \, {\left (18 \, a^{2} b + 5 \, b^{3}\right )} x + \frac {{\left (4 \, a^{3} + 15 \, a b^{2}\right )} \cos \left (3 \, f x + 3 \, e\right )}{48 \, f} - \frac {{\left (2 \, a^{3} + 9 \, a b^{2}\right )} \cos \left (f x + e\right )}{8 \, f} - \frac {{\left (2 \, a^{3} + 3 \, a b^{2}\right )} \cos \left (f x + e\right )}{4 \, f} + \frac {3 \, {\left (2 \, a^{2} b + b^{3}\right )} \sin \left (4 \, f x + 4 \, e\right )}{64 \, f} - \frac {3 \, {\left (16 \, a^{2} b + 5 \, b^{3}\right )} \sin \left (2 \, f x + 2 \, e\right )}{64 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.40, size = 417, normalized size = 2.44 \begin {gather*} \frac {b\,\mathrm {atan}\left (\frac {b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (18\,a^2+5\,b^2\right )}{8\,\left (\frac {9\,a^2\,b}{4}+\frac {5\,b^3}{8}\right )}\right )\,\left (18\,a^2+5\,b^2\right )}{8\,f}-\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (\frac {9\,a^2\,b}{4}+\frac {5\,b^3}{8}\right )+4\,a^3\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^8+\frac {16\,a\,b^2}{5}+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (16\,a^3+48\,a\,b^2\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6\,\left (\frac {40\,a^3}{3}+32\,a\,b^2\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (8\,a^3+\frac {96\,a\,b^2}{5}\right )-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^{11}\,\left (\frac {9\,a^2\,b}{4}+\frac {5\,b^3}{8}\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5\,\left (\frac {21\,a^2\,b}{2}+\frac {33\,b^3}{4}\right )-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^7\,\left (\frac {21\,a^2\,b}{2}+\frac {33\,b^3}{4}\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,\left (\frac {51\,a^2\,b}{4}+\frac {85\,b^3}{24}\right )-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^9\,\left (\frac {51\,a^2\,b}{4}+\frac {85\,b^3}{24}\right )+\frac {4\,a^3}{3}}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^{12}+6\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^{10}+15\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^8+20\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6+15\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+6\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+1\right )}-\frac {b\,\left (18\,a^2+5\,b^2\right )\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )-\frac {f\,x}{2}\right )}{8\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________